import layoutHeaderAside from '@/layout/header-aside'
// 由于懒加载页面太多的话会造成webpack热更新太慢，所以开发环境不使用懒加载，只有生产环境使用懒加载
const _import = require('@/libs/util.import.' + process.env.NODE_ENV)
/**
 * 在主框架内显示
 */
const frameIn = [
  {
    path: '/',
    redirect: { name: 'index' },
    component: layoutHeaderAside,
    children: [
      {
        path: 'index',
        name: 'index',
        meta: {
          auth: true
        },
        component: _import('system/index')
      },
      {
        path: 'configone',
        name: 'configone',
        meta: {
          title: '配置项',
          auth: true
        },
        component: _import('setconfig/configone')
      },
      {
        path: 'DY_audit',
        name: 'DY_audit',
        meta: {
          title: '抖音刷手审核',
          auth: true
        },
        component: _import('brushhand/DY_audit')
      },
      {
        path: 'PDDaudit',
        name: 'PDDaudit',
        meta: {
          title: '拼多多刷手审核',
          auth: true
        },
        component: _import('brushhand/PDDaudit')
      },
      {
        path: 'brush_details',
        name: 'brush_details',
        meta: {
          title: '刷手操作明细',
          auth: true
        },
        component: _import('brushhand/brush_details')
      },
      {
        path: 'reacrge_details',
        name: 'reacrge_details',
        meta: {
          title: '后台充值明细',
          auth: true
        },
        component: _import('brushhand/Back_reacrge_details')
      },
      {
        path: 'acount_pay',
        name: 'acount_pay',
        meta: {
          title: '商户充值',
          auth: true
        },
        component: _import('brushhand/AccountPay')
      },
      {
        path: 'AccountDetails',
        name: 'AccountDetails',
        meta: {
          title: '财务提现',
          auth: true
        },
        component: _import('brushhand/AccountDetails')
      },
      {
        path: 'reviewEvaluate',
        name: 'reviewEvaluate',
        meta: {
          title: '财务提现',
          auth: true
        },
        component: _import('brushhand/reviewEvaluate')
      },
      {
        path: 'OtherRaskList',
        name: 'OtherRaskList',
        meta: {
          title: '额外任务列表',
          auth: true
        },
        component: _import('brushhand/OtherRaskList')
      },
      {
        path: 'DWWAudit',
        name: 'DWWAudit',
        meta: {
          title: '多旺旺审核',
          auth: true
        },
        component: _import('brushhand/DWWAudit')
      },
      {
        path: 'merchantconsumption',
        name: 'merchantconsumption',
        meta: {
          title: '商家消费明细',
          auth: true
        },
        component: _import('brushhand/merchantconsumption')
      },
      {
        path: 'permisset',
        name: 'permisset',
        meta: {
          title: '用户列表',
          auth: true
        },
        component: _import('permissions/permisset')
      },
      {
        path: 'GoodsList',
        name: 'GoodsList',
        meta: {
          title: '发货列表',
          auth: true
        },
        component: _import('brushhand/Goods')
      },
      {
        path: 'brushhandlist',
        name: 'brushhandlist',
        meta: {
          title: '刷手信息',
          auth: true
        },
        component: _import('brushhand/brushhandlist')
      },
      {
        path: 'brushhandaudit',
        name: 'brushhandaudit',
        meta: {
          title: '刷手审核',
          auth: true
        },
        component: _import('brushhand/brushhandaudit')
      },
      {
        path: 'cardaudit',
        name: 'cardaudit',
        meta: {
          title: '银行卡审核',
          auth: true
        },
        component: _import('brushhand/cardaudit')
      },
      {
        path: 'statistics',
        name: 'statistics',
        meta: {
          title: '任务利润明细',
          auth: true
        },
        component: _import('brushhand/statistics')
      },
      {
        path: 'Merchant_price_modification',
        name: 'Merchant_price_modification',
        meta: {
          title: '商户价格修改',
          auth: true
        },
        component: _import('brushhand/Merchant_price_modification')
      },
      {
        path: 'Role_list',
        name: 'Role_list',
        meta: {
          title: '角色列表',
          auth: true
        },
        component: _import('brushhand/Role_list')
      },
      {
        path: 'Change_Audit',
        name: 'Change_Audit',
        meta: {
          title: '换旺旺审核',
          auth: true
        },
        component: _import('brushhand/Change_Audit')
      },
      {
        path: 'brushhandauditlevel',
        name: 'brushhandauditlevel',
        meta: {
          title: '升级师傅审核',
          auth: true
        },
        component: _import('brushhand/brushhandauditlevel')
      },
      {
        path: 'merchants',
        name: 'merchants',
        meta: {
          title: '商户激活',
          auth: true
        },
        component: _import('brushhand/merchants')
      },
      {
        path: 'timedetails',
        name: 'timedetails',
        meta: {
          title: '时间点任务详情',
          auth: true
        },
        component: _import('brushhand/timedetails')
      },
      {
        path: 'missingtask',
        name: 'missingtask',
        meta: {
          title: '当天未发任务',
          auth: true
        },
        component: _import('brushhand/Missingtask')
      },
      {
        path: 'powerinfo',
        name: 'powerinfo',
        meta: {
          title: '菜单管理',
          auth: true
        },
        component: _import('brushhand/PowerInfo')
      },
      {
        path: 'Commercial_flag',
        name: 'Commercial_flag',
        meta: {
          title: '商户插旗',
          auth: true
        },
        component: _import('brushhand/Commercial_flag')
      },
      {
        path: 'shoplist',
        name: 'shoplist',
        meta: {
          title: '店铺信息',
          auth: true
        },
        component: _import('brushhand/shoplist')
      },
      {
        path: 'tasklist',
        name: 'tasklist',
        meta: {
          title: '任务列表',
          auth: true
        },
        component: _import('brushhand/tasklist')
      },
      {
        path: 'taskorder',
        name: 'taskorder',
        meta: {
          title: '订单列表',
          auth: true
        },
        component: _import('brushhand/taskorder')
      },
      {
        path: 'taskmonitor',
        name: 'taskmonitor',
        meta: {
          title: '任务监控',
          auth: true
        },
        component: _import('brushhand/taskmonitor')
      },
      // 系统 前端日志
      {
        path: 'log',
        name: 'log',
        meta: {
          title: '前端日志',
          auth: true
        },
        component: _import('system/log')
      },
      // 刷新页面 必须保留
      {
        path: 'refresh',
        name: 'refresh',
        hidden: true,
        component: _import('system/function/refresh')
      },
      // 页面重定向 必须保留
      {
        path: 'redirect/:route*',
        name: 'redirect',
        hidden: true,
        component: _import('system/function/redirect')
      }
    ]
  }
]
/**
 * 在主框架之外显示
 */
const frameOut = [
  // 登录
  {
    path: '/login',
    name: 'login',
    component: _import('system/login')
  }
]

/**
 * 错误页面
 */
const errorPage = [
  {
    path: '*',
    name: '404',
    component: _import('system/error/404')
  }
]

// 导出需要显示菜单的
export const frameInRoutes = frameIn

// 重新组织后导出
export default [
  ...frameIn,
  ...frameOut,
  ...errorPage
]
